define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'mall.travel/index',
        add_url: 'mall.travel/add',
        edit_url: 'mall.travel/edit',
        delete_url: 'mall.travel/delete',
        export_url: 'mall.travel/export',
        modify_url: 'mall.travel/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    { type: "checkbox" },
                    { field: 'id', width: 80, title: 'ID' },
                    { field: 'sort', width: 80, title: '排序', edit: 'text' },
                    { field: 'title', minWidth: 80, title: '名称' },
                    { field: 'image',  minWidth: 80, title: '图片',search:false,templet:ea.table.image},
                    { field: 'introduce', minWidth: 80, title: '介绍', },
                    { field: 'skill', minWidth: 80, title: '技能' },
                    { field: 'label', width: 100, title: '标签', },
                    { field: 'state', title: '状态', width: 85, selectList: { 0: '禁用', 1: '启用' }, templet: ea.table.switch },
                    {width: 250, title: '操作', templet: ea.table.tool}
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});
